home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / BUS / N-Z / wordrefer.sea / Word Reference / WordRef Stack 1.2 / background_13702.txt < prev    next >
Text File  |  1992-04-14  |  8KB  |  370 lines

  1. -- background: 13702 from stack: in.2
  2. -- bmap block id: 4517
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Instruction
  6. ----- HyperTalk script -----
  7. on openBackground
  8.   -- Should really be in the openStack handler, but, at least for me,
  9.   -- this never gets executed!?!
  10.   if the short version of HyperCard < 1.2 then
  11.     answer "This stack needs HyperCard 1.2 or later to run." with "Sorry"
  12.     go home
  13.   end if
  14.   show menubar
  15.   hide msg box
  16.   pass openBackground
  17. end openBackground
  18.  
  19.  
  20.  
  21.  
  22. -- part 85 (field)
  23. -- low flags: 01
  24. -- high flags: 0000
  25. -- rect: left=288 top=113 right=128 bottom=337
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 0
  29. -- font id: 3
  30. -- text size: 10
  31. -- style flags: 0
  32. -- line height: 13
  33. -- part name: version
  34.  
  35.  
  36. -- part 80 (button)
  37. -- low flags: 00
  38. -- high flags: A004
  39. -- rect: left=140 top=305 right=335 bottom=251
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Export BibTeX…
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   global gFileName
  51.  
  52.   put rawFileName(gFileName) into rawFile
  53.   if rawFile is empty
  54.   then put the short name of this stack & ".bib" into rawFile
  55.   put StdFile(put, "Save to BibTeX file:", rawFile) into newFile
  56.   if newFile is empty then exit mouseUp
  57.   answer "Is this for use with WordRef?" with "Cancel" or "Other BibTeX" or "WordRef"
  58.   put it into doWordRef
  59.   if it is "Cancel" then exit mouseUp
  60.   set cursor to watch
  61.   put newFile into gFileName
  62.   lock screen
  63.   WriteBibTeX gFileName, doWordRef
  64.   unlock screen
  65.   hide msg box
  66. end mouseUp
  67.  
  68. -- returns the "short" name of a file name
  69. function rawFileName fileName
  70. put offset(":",fileName) into index
  71. repeat while index <> 0
  72.   put the number of chars of fileName into numChars
  73.   put char index+1 to numChars of fileName into fileName
  74.   put offset(":",fileName) into index
  75. end repeat
  76. return fileName
  77. end rawFileName
  78.  
  79.  
  80.  
  81.  
  82. -- part 82 (button)
  83. -- low flags: 00
  84. -- high flags: 2004
  85. -- rect: left=8 top=246 right=286 bottom=48
  86. -- title width / last selected line: 0
  87. -- icon id / first selected line: 8538 / 8538
  88. -- text alignment: 1
  89. -- font id: 0
  90. -- text size: 12
  91. -- style flags: 0
  92. -- line height: 16
  93. -- part name: Find
  94. ----- HyperTalk script -----
  95. on mouseUp
  96.   doMenu "Find..."
  97. end mouseUp
  98.  
  99.  
  100.  
  101. -- part 84 (button)
  102. -- low flags: 00
  103. -- high flags: A004
  104. -- rect: left=353 top=305 right=335 bottom=410
  105. -- title width / last selected line: 0
  106. -- icon id / first selected line: 0 / 0
  107. -- text alignment: 1
  108. -- font id: 0
  109. -- text size: 12
  110. -- style flags: 0
  111. -- line height: 16
  112. -- part name: Clear…
  113. ----- HyperTalk script -----
  114. on mouseUp
  115.   answer "Really delete all references from the stack?" with "Yes" or "No"
  116.   if it is "No" then exit mouseUp
  117.   set cursor to watch
  118.   lock screen
  119.   put the id of this card into myself
  120.   go next
  121.   repeat until the id of this card is myself
  122.     -- clear the card if it's the last of its kind
  123.     if the number of cds of this bg = 1 then
  124.       repeat with i = 1 to the number of bg flds
  125.         put empty into bg field i
  126.       end repeat
  127.       go next
  128.     else
  129.       doMenu "Delete Card"
  130.     end if
  131.   end repeat
  132.   unlock screen
  133. end mouseUp
  134.  
  135.  
  136.  
  137. -- part 86 (field)
  138. -- low flags: 01
  139. -- high flags: 0001
  140. -- rect: left=107 top=45 right=82 bottom=456
  141. -- title width / last selected line: 0
  142. -- icon id / first selected line: 0 / 0
  143. -- text alignment: 1
  144. -- font id: 20
  145. -- text size: 24
  146. -- style flags: 256
  147. -- line height: 32
  148. -- part name: Title
  149.  
  150.  
  151. -- part 87 (button)
  152. -- low flags: 00
  153. -- high flags: A004
  154. -- rect: left=140 top=273 right=303 bottom=251
  155. -- title width / last selected line: 0
  156. -- icon id / first selected line: 0 / 0
  157. -- text alignment: 1
  158. -- font id: 0
  159. -- text size: 12
  160. -- style flags: 0
  161. -- line height: 16
  162. -- part name: Import BibTeX…
  163. ----- HyperTalk script -----
  164. on mouseUp
  165.   put StdFile(get, "TEXT") into inFile
  166.   if inFile is empty then exit mouseUp
  167.   set cursor to watch
  168.   lock screen
  169.   ReadBibTeX inFile
  170.   if the result is not empty then
  171.     answer the result with "OK"
  172.   end if
  173.   put "Sorting..."
  174.   sort by fld "keyField"
  175.   unlock screen
  176.   hide msg box
  177. end mouseUp
  178.  
  179.  
  180.  
  181. -- part 89 (button)
  182. -- low flags: 00
  183. -- high flags: A004
  184. -- rect: left=257 top=273 right=303 bottom=410
  185. -- title width / last selected line: 0
  186. -- icon id / first selected line: 0 / 0
  187. -- text alignment: 1
  188. -- font id: 0
  189. -- text size: 12
  190. -- style flags: 0
  191. -- line height: 16
  192. -- part name: Find Duplicate Keys
  193. ----- HyperTalk script -----
  194. on mouseUp
  195.   set cursor to watch
  196.   lock screen
  197.   sort by bg fld "keyField"
  198.   put the id of this cd into myself
  199.   go next
  200.   put empty into lastKey
  201.   repeat until the id of this cd is myself
  202.     if bg fld "keyField" is not empty then
  203.       if bg fld "keyField" = lastKey then
  204.         put "This card and the previous have key" && quote & lastKey & quote
  205.         exit mouseUp
  206.       end if
  207.       put bg fld "keyField" into lastKey
  208.     end if
  209.     go next
  210.   end repeat
  211.   unlock screen
  212.   put "No duplicates"
  213. end mouseUp
  214.  
  215.  
  216.  
  217. -- part 88 (button)
  218. -- low flags: 00
  219. -- high flags: 2004
  220. -- rect: left=8 top=204 right=244 bottom=48
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 32462 / 32462
  223. -- text alignment: 1
  224. -- font id: 0
  225. -- text size: 12
  226. -- style flags: 0
  227. -- line height: 16
  228. -- part name: Help
  229. ----- HyperTalk script -----
  230. on mouseUp
  231.   show cd fld "Help Field"
  232. end mouseUp
  233.  
  234.  
  235.  
  236. -- part 90 (button)
  237. -- low flags: 00
  238. -- high flags: 2000
  239. -- rect: left=70 top=17 right=57 bottom=110
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 24830 / 24830
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: Next
  248. ----- HyperTalk script -----
  249. on mouseUp
  250.   lock screen
  251.   go card 15
  252.   --  put the id of this cd into myself
  253.   --  go next
  254.   --  repeat until the id of this cd is myself
  255.   --    if bg fld "keyField" is not empty then exit mouseUp
  256.   --    go next
  257.   --  end repeat
  258. end mouseUp
  259.  
  260.  
  261.  
  262. -- part 91 (button)
  263. -- low flags: 00
  264. -- high flags: A004
  265. -- rect: left=257 top=305 right=335 bottom=348
  266. -- title width / last selected line: 0
  267. -- icon id / first selected line: 0 / 0
  268. -- text alignment: 1
  269. -- font id: 0
  270. -- text size: 12
  271. -- style flags: 0
  272. -- line height: 16
  273. -- part name: New Stack…
  274. ----- HyperTalk script -----
  275. on mouseUp
  276.   put the short name of this stack into source
  277.   put StdFile(put, "Save a Copy:","Copy of"&&source) into dest
  278.   if dest is empty then exit mouseUp
  279.   set cursor to watch
  280.   put word 2 of the long name of this stack into source
  281.   put char 2 to number of chars of source - 1 of source into source
  282.   CopyFile source,dest
  283.   if the result is not empty then
  284.     put "Error in copy:" && the result
  285.     exit mouseUp
  286.   end if
  287.   go dest
  288. end mouseUp
  289.  
  290.  
  291.  
  292. -- part 93 (button)
  293. -- low flags: 00
  294. -- high flags: 2004
  295. -- rect: left=8 top=36 right=76 bottom=48
  296. -- title width / last selected line: 0
  297. -- icon id / first selected line: 20098 / 20098
  298. -- text alignment: 1
  299. -- font id: 0
  300. -- text size: 12
  301. -- style flags: 0
  302. -- line height: 16
  303. -- part name: Home
  304. ----- HyperTalk script -----
  305. on mouseUp
  306.   visual iris close
  307.   go home
  308. end mouseUp
  309.  
  310.  
  311.  
  312. -- part 94 (button)
  313. -- low flags: 00
  314. -- high flags: 2004
  315. -- rect: left=8 top=78 right=118 bottom=48
  316. -- title width / last selected line: 0
  317. -- icon id / first selected line: 3430 / 3430
  318. -- text alignment: 1
  319. -- font id: 0
  320. -- text size: 12
  321. -- style flags: 0
  322. -- line height: 16
  323. -- part name: New Item
  324. ----- HyperTalk script -----
  325. on mouseDown
  326.   get PopUpMenu(0, "Article,Book,Booklet,InBook,InCollection", "InProceedings,Manual,MastersThesis,Misc,PhDThesis", "Proceedings,TechReport,Unpublished")
  327.   set hilite of the target to false
  328.   if item 1 of it is empty then exit mouseDown
  329.   NewBackground (item 1 of it)
  330. end mouseDown
  331.  
  332.  
  333.  
  334. -- part 95 (button)
  335. -- low flags: 00
  336. -- high flags: 2004
  337. -- rect: left=8 top=120 right=160 bottom=48
  338. -- title width / last selected line: 0
  339. -- icon id / first selected line: 20186 / 20186
  340. -- text alignment: 1
  341. -- font id: 0
  342. -- text size: 12
  343. -- style flags: 0
  344. -- line height: 16
  345. -- part name: Sort Items
  346. ----- HyperTalk script -----
  347. on mouseUp
  348.   sort by fld "keyField"
  349. end mouseUp
  350.  
  351.  
  352.  
  353. -- part 96 (button)
  354. -- low flags: 00
  355. -- high flags: 2004
  356. -- rect: left=8 top=162 right=202 bottom=48
  357. -- title width / last selected line: 0
  358. -- icon id / first selected line: 32670 / 32670
  359. -- text alignment: 1
  360. -- font id: 0
  361. -- text size: 12
  362. -- style flags: 0
  363. -- line height: 16
  364. -- part name: Scan Items
  365. ----- HyperTalk script -----
  366. on mouseUp
  367.   show all cds
  368. end mouseUp
  369.  
  370.